package com.hjy.myocr;


import atlantafx.base.theme.PrimerLight;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.URLUtil;
import com.hjy.util.FileCreateUtil;
import com.hjy.view.View1;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

import java.io.File;
import java.io.IOException;
import java.net.URL;

public class OcrApplication extends Application {

    public static View1 view1;

    @Override
    public void start(Stage stage) throws IOException {
        try {
            FileCreateUtil.createDir("/logs");
            OcrApplication.setUserAgentStylesheet(new PrimerLight().getUserAgentStylesheet());
            FXMLLoader fxmlLoader = new FXMLLoader(View1.class.getResource("View1.fxml"));
            Scene scene = new Scene(fxmlLoader.load(), 1250, 500);
            view1 = fxmlLoader.getController();
            stage.setTitle("OCR");
            //ICON
            URL url2 = this.getClass().getResource("/images/def.jpeg");
            stage.getIcons().add(new Image(url2.openStream()));
            //关闭最大化按钮
            //stage.setResizable(false);
            stage.setScene(scene);
            stage.setMinWidth(1250);
            stage.setMinHeight(500);
            stage.show();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    public static void main(String[] args) {
        launch();
    }
}